<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>会员信息修改</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/xadmin.css">
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/Swiper/3.4.2/css/swiper.min.css">
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/xadmin.js"></script>
</head>
<body>
<!-- 中部开始 -->
<div class="wrapper">
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <form class="layui-form" action="${pageContext.request.contextPath}/admin/editCourse.action" method="post">
                <input type="text" name="courseid" value="${editCourseShow.courseid}" hidden>
                <div class="layui-form-item">
                    <label for="L_coursename" class="layui-form-label">
                        <span class="x-red">*</span>课程名
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="L_coursename" name="coursename"
                               autocomplete="off" class="layui-input" value="${editCourseShow.coursename}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_coursemoney" class="layui-form-label">
                        <span class="x-red">*</span>价格
                    </label>
                    <div class="layui-input-inline">
                        <input type="number" id="L_coursemoney" name="coursemoney"
                               autocomplete="off" class="layui-input" value="${editCourseShow.coursemoney}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_coursestart" class="layui-form-label">
                        <span class="x-red">*</span>开始时间
                    </label>
                    <div class="layui-input-inline">
                        <input type="date" id="L_coursestart" name="coursestart"
                               autocomplete="off" class="layui-input" value='<fmt:formatDate value="${editCourseShow.coursestart}" pattern="yyyy-MM-dd"/>'>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_courseend" class="layui-form-label">
                        <span class="x-red">*</span>结束时间
                    </label>
                    <div class="layui-input-inline">
                        <input type="date" id="L_courseend" name="courseend"
                               autocomplete="off" class="layui-input" value='<fmt:formatDate value="${editCourseShow.courseend}" pattern="yyyy-MM-dd"/>'>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_courseMem" class="layui-form-label">
                        <span class="x-red">*</span>课程人数
                    </label>
                    <div class="layui-input-inline">
                        <input type="number" id="L_courseMem" name="courseMem"
                               autocomplete="off" class="layui-input" value="${editCourseShow.courseMem}" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_courseweek" class="layui-form-label">
                        <span class="x-red">*</span>星期几
                    </label>
                    <div class="layui-input-inline">
                        <select class="layui-input" name="courseweek" autocomplete="off" id="L_courseweek" value=${editCourseShow.courseweek}>
                            <option value=1 <c:if test="${editCourseShow.courseweek==1}">selected</c:if>>星期一</option>
                            <option value=2 <c:if test="${editCourseShow.courseweek==2}">selected</c:if>>星期二</option>
                            <option value=3 <c:if test="${editCourseShow.courseweek==3}">selected</c:if>>星期三</option>
                            <option value=4 <c:if test="${editCourseShow.courseweek==4}">selected</c:if>>星期四</option>
                            <option value=5 <c:if test="${editCourseShow.courseweek==5}">selected</c:if>>星期五</option>
                            <option value=6 <c:if test="${editCourseShow.courseweek==6}">selected</c:if>>星期六</option>
                            <option value=7 <c:if test="${editCourseShow.courseweek==7}">selected</c:if>>星期天</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_coursesection" class="layui-form-label">
                        <span class="x-red">*</span>第几节
                    </label>
                    <div class="layui-input-inline">
                        <select class="layui-input" name="coursesection" autocomplete="off" id="L_coursesection" value=${editCourseShow.coursesection}>
                            <c:forEach var="section" items="${sectionList}">
                                <option value=${section.sectionid} <c:if test="${editCourseShow.coursesection==section.sectionid}">selected</c:if>>${section.sectionname}</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_coursecoach" class="layui-form-label">
                        <span class="x-red">*</span>教练
                    </label>
                    <div class="layui-input-inline">
                        <select class="layui-input" name="coursecoach" autocomplete="off" id="L_coursecoach" value=${editCourseShow.coursecoach}>
                            <c:forEach var="coach" items="${editCoachShow}">
                                <option value=${coach.coachid} <c:if test="${editCourseShow.coursecoach==coach.coachid}">selected</c:if>>${coach.coachrealname}</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_card" class="layui-form-label">
                        <span class="x-red">*</span>教室
                    </label>
                    <div class="layui-input-inline">
                        <select class="layui-input" name="courseclassroom" autocomplete="off" id="L_card" value=${editCourseShow.courseclassroom}>
                            <c:forEach var="room" items="${editRoomShow}">
                                <option value=${room.classroomid} <c:if test="${editCourseShow.courseclassroom==room.classroomid}">selected</c:if>>${room.classroomname}</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_card" class="layui-form-label">
                        <span class="x-coursestates">*</span>课程状态
                    </label>
                    <div class="layui-input-inline">
                        <select class="layui-input" name="coursestates" autocomplete="off" id="L_coursestates">
                            <option value="0" <c:if test="${editCourseShow.coursestates=='0'}">selected</c:if>>结束</option>
                            <option value="1" <c:if test="${editCourseShow.coursestates=='1'}">selected</c:if>>开始</option>
                            <option value="2" <c:if test="${editCourseShow.coursestates=='2'}">selected</c:if>>报名中</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label for="L_card" class="layui-form-label">
                    </label>
                    <button type="submit" class="layui-btn" lay-filter="add">
                        修改
                    </button>
                    &nbsp;&nbsp;&nbsp;
                    <button type="button" class="layui-btn" onclick="x_admin_close()">
                        返回
                    </button>
                </div>
            </form>
        </div>
            <!-- 右侧内容框架，更改从这里结束 -->
        </div>
    </div>
    <!-- 右侧主体结束 -->
</div>
<!-- 中部结束 -->
<script>
    function edits() {
        layer.confirm('确认要修改吗？',function(){
            $(".layui-form").submit();
            layer.msg('修改成功', {icon: 1});
        });
    }
</script>
</body>
</html>
